<?php
session_start();
?>
<html>

<head>
<?php $a[0] = "active"; ?>
<?php
include ('head.php');

?>
<script>
	$(document).ready(function(){	
		/* Nap noi dung comment cu */
		$.post("noidung.php",function(data){
					$(".noidung").html(data);
		});
		/* an hien cac emotion */
		$("#emotion").hide();
		$("#showEmotion").click(function(){
			$("#emotion").toggle();
		});
		/* Khi click vao emotion thi lay gia tri gan vao textarea */
		$(".emoticon").click(function(){
			var comment = $("#comment").val();
			var emoticon = $(this).attr("value");			
			$("#comment").val(comment + " " +  emoticon + " ");
		});
	
	
		/* Click nut Send them comment moi vao CSDL*/
		$("#btnGui").click(function(){
			var noidung=$("#comment").val();
			var hoten=$("#hoten").val();
			$.post("insert.php",{Ten:hoten,NoiDung:noidung},function(data){
				$("#hoten").val("");
				$("#comment").val("");
				
				/* load noi dung comment sau khi them comment moi*/
				$.get("noidung.php",function(data){
					$(".noidung").html(data);
				});
				
			});
		});		
	
	});
</script>
        <script type="text/javascript">
            jQuery(document).ready(function() {
                jQuery('#product').j360();
            });
        </script>
<script type="text/javascript">
//<![CDATA[
(function() {
	var links = document.getElementsByTagName('a');
	var query = '?';
	for(var i = 0; i < links.length; i++) {
	if(links[i].href.indexOf('#disqus_thread') >= 0) {
		query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
	}
	}
	document.write('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/professorcloud/get_num_replies.js' + query + '"></' + 'script>');
})();
//]]>
</script>
</head>
<body>

<?php
include ('dbcon.php');
include ('webtitle.php');
include ('topbannermenu.php');
include ('leftmenu.php');
?>	


<div id = "divMid2">
<div id = "pro4">
        <center>
<font color="#CCFF00"> <br><h1>CHI TIẾT ĐIỆN THOẠI
  
</h1>
</font>
</center>
<?php
   $iddd = $_SESSION['CTDT'];
   $row = "";
   $query=mysql_query("select * from sanpham where sanpham.MaSP ='$iddd'");
   $querys = mysql_query("select SoLuongTonKho from sanpham where masp = '$iddd'");
   
   while($row=mysql_fetch_array($query))
   {
	   
   echo "<div id='chitiet1'>";
   echo "<h3>$row[2]</h3><br />";
  
   echo "<font color='#FF0000'><h4>Đơn Giá: ". number_format($row[3],0) ." VND</h4></br></font>";
   $i = 0;
 
   $SLTK = 0;
   
   while ($rows = mysql_fetch_array($querys))
   {
	   $SLTK = $rows[0];
	}
   ?>    
<?php 
		include ('slideshow.php');
	?>
	  </div>
	
	
   <?php
   if($SLTK < 1)
   {
		echo "Đã hết hàng !"   ;
	}
	else
	{
	echo "<form action='addDT.php?item=$row[0]' method ='post'>"; ?>
    <input align="right" class = "css" name="btn_MuaHang" type="submit" id="btn_MuaHang" value="Mua Hàng">
	
   </form>
   
    <?php
	}
	echo "<form action='ss.php?itemss=$row[0]' method ='post'>" ?>
    <input align="right" class = "css" name="btn_sosanh" type="submit"  value=" Thêm vào so sánh ">

   </form>


<center>

    <?php
   include ('tabCTDT.php');
   ?>
   <?php
}

?>

</center>

</div>


		<div class="clr"></div>
		<?php 
		include ('footer.php');
		?>
</div></div>
</body>
</html>